package com.markyao.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
@RequestMapping("/")
public class DistpatchController {

    @GetMapping("index")
    public void index(HttpServletRequest request, HttpServletResponse response){
        try {
            response.sendRedirect("pages/admin.html");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

//    @GetMapping("details/{appName}")
//    public void details(@PathVariable("appName")String appName, HttpServletRequest request, HttpServletResponse response){
//        try {
//            response.sendRedirect("pages/details.html");
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
}
